<?php
/**
 * @copyright   2008-2014 简好网络 <http://www.phpshe.com>
 * @creatdate   2012-0501 koyshe <koyshe@gmail.com>
 */
pe_lead('hook/cache.hook.php');
$menumark = 'setting';
switch ($act) {
    //#####################@ 公司介绍设置 @#####################//
    case 'set':

        include(pe_tpl('setting_introduction.html'));
        break;
    //#####################@ 章程 @#####################//
    case 'rule':

        include(pe_tpl('setting_rule.html'));
        break;
    //#####################@ 架构 @#####################//
    case 'organization':
        include(pe_tpl('setting_organization.html'));
        break;
    //#####################@ 网站设置 @#####################//
    default:
        if (isGet()) {
            $setting = $db->index('setting_key')->pe_selectall('setting');

            include(pe_tpl('setting_base.html'));
        } else if (isPost()) {
//            mp($_p_info);exit;
            $sql = "update `" . dbpre . "setting` set `setting_value` = case `setting_key`  
				when 'web_title' then '" . pe_dbhold($_p_info['web_title']) . "'
				when 'web_address' then '" . pe_dbhold($_p_info['web_address']) . "'
				when 'web_copyright' then '" . pe_dbhold($_p_info['web_copyright']) . "'
				when 'web_lng' then '" . pe_dbhold($_p_info['web_lng']) . "'
				when 'web_lat' then '" . pe_dbhold($_p_info['web_lat']) . "'
				when 'web_vipup' then '" . pe_dbhold($_p_info['web_vipup']) . "'
				when 'web_vipopen' then '" . pe_dbhold($_p_info['web_vipopen']) . "'
				when 'web_instruction' then '" . pe_dbhold($_p_info['web_instruction']) . "'
				when 'web_near_station' then '" . pe_dbhold($_p_info['web_near_station']) . "'
				when 'web_near_interest' then '" . pe_dbhold($_p_info['web_near_interest']) . "'
				when 'web_airport' then '" . pe_dbhold($_p_info['web_airport']) . "'
				when 'web_vipadv' then '" . pe_dbhold($_p_info['web_vipadv']) . "'
				when 'web_icp' then '" . pe_dbhold($_p_info['web_icp']) . "' else `setting_value` end";
                
            if ($db->sql_update($sql)) {
                cache_write('setting');
                pe_success('设置成功!');
            } else {
                pe_error('设置失败...');
            }
        }

        break;
}
?>